package cn.lut.springboot;

import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;

/**
 * @user:dell
 * @date:2021年01月05 18:00
 */
@Configuration
public class AtguiguCloudConfig {
    @Bean
//    这个注解让RestTemplate有负载均衡功能，通过调用ribbon访问provider集群
    @LoadBalanced
    public RestTemplate getRestTemplate() {
        return new RestTemplate();
    }
}
